 strp(delimiter: str, text: str, mode: str):
    """
    Splits the text using the given delimiter.

    Modes:
      'l': Returns the left-side portion before the first occurrence of the delimiter.
      'r': Returns the right-side portion after the last occurrence of the delimiter.
      'b': Returns a list of non-empty segments split by the delimiter.
           (If the delimiter appears multiple times, all segments are returned.)

    If the delimiter is not found, the original text is returned.
    """
    if mode == 'l':
        idx = text.find(delimiter)
        return text[:idx] if idx != -1 else text
    elif mode == 'r':
        idx = text.rfind(delimiter)
        return text[idx+len(delimiter):] if idx != -1 else text
    elif mode == 'b':
        return [seg for seg in text.split(delimiter) if seg]
    else:
        raise ValueError("Invalid mode. Use 'l', 'r', or 'b'.")
#print(strp(" ","git clone github","b"))
